export const ADD_COUNT = 'ADD_COUNT'
export const SET_COUNT = 'SET_COUNT'

interface IAddCountAction {
  type: typeof ADD_COUNT;
  payload: number
}

interface ISetCountAction {
  type: typeof SET_COUNT;
  payload: number
}

export type ICountAction = IAddCountAction | ISetCountAction;

export const addCount = (num: number): IAddCountAction => {
  return {
    type: ADD_COUNT,
    payload: num
  }
}

export const setCount = (num: number): ISetCountAction => {
  return {
    type: SET_COUNT,
    payload: num
  }
}
